<style scoped>
.view {
  line-height: 32px;
  font-size: 14px;
  font-weight: bold;
  list-style-type: none;
  padding: 0 12px;
  display: flex;
  flex-flow: column;
  min-height: 32px;
  cursor: pointer;
  color: #f5f5f5;
  background-color: #e6a23c;
  position: relative;
  top: -1px;
}
.view:hover {
  background-color: #ebb563;
}
</style>
<!--  -->
<template>
  <div class="view" @click="viewDefaultDomain">浏&nbsp;览</div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  computed: {
    ...mapState([
      'site'
    ])
  },
  data () {
    return {
    }
  },
  methods: {
    viewDefaultDomain () {
      if (this.site.defaultdomain && this.site.defaultdomain.domainName) {
        let domainName = this.site.defaultdomain.domainName
        if (domainName) {
          let url = 'http://' + domainName + '/'
          window.open(url)
        }
      }
    }
  }
}

</script>
